<template>
    <div>
       <h2>你好测试Vuex</h2>
        <div>
          <h3>
              初始值: 我是从state内获取的值: {{this.$store.state.count}}
          </h3>
          <h3>
              初始值: 我是从getters上获得的值: {{this.$store.getters.isChangeNum}}
          </h3>
        </div>
         <h2>使用mutations</h2>
         <div>
             <el-button @click="add">
                 增加+
             </el-button>

             <el-button @click="del" type="primary">
                 减少-
             </el-button>

         </div>
    </div>
    
</template>

<script>
export default {
    data () {
        return {

        }
    },
    methods: {
        add() {
            this.$store.commit('addCount','20')
        },
        del() {
            this.$store.commit('delCount','50')
        }
    }
}
</script>